<template>
  <div />
</template>

<script setup lang="ts">
import { onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'

// 通用重定向页面：根据路由参数将用户重定向到目标路径
const route = useRoute()
const router = useRouter()

onMounted(() => {
  const raw = route.params.path as string | string[] | undefined
  let target = '/'
  if (Array.isArray(raw)) {
    target = '/' + raw.join('/')
  } else if (raw) {
    target = raw.startsWith('/') ? raw : '/' + raw
  }
  router.replace(target)
})
</script>


